package com.general.framework.example.filterRepeatArrayListItem;

import java.util.*;

public class Main {  private static <T> List<T> getSignalElement(List arr, Class<T> clazz) {
        List temp = new ArrayList();
        Iterator it = arr.iterator();
        while (it.hasNext()) {
            T p = (T) it.next();
            if (!temp.contains(p)) {
                temp.add(p);
            }
        }
        return temp;
    }

    public static void main(String[] args) {
        List<User> users = new ArrayList<>();
        User s1 = new User("林青霞", 30);
        User s2 = new User("风清扬", 33);
        User s3 = new User("林青霞", 31);
        users.add(s1);
        users.add(s2);
        users.add(s3);
        List<User> signalElement = getSignalElement(users, User.class);
        System.out.println(signalElement);

    }
}
